Skip to content

Conversation

barbados-clemens
Copy link
Contributor

@barbados-clemens barbados-clemens commented Sep 11, 2025

see new entry here: https://nx-dev-git-cu-doc-155-sitemaps-nrwl.vercel.app/sitemap.xml as exmaple
Fixes DOC-155

@barbados-clemens barbados-clemens self-assigned this Sep 11, 2025
Copy link

vercel bot commented Sep 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Sep 11, 2025 11:22pm

Copy link
Contributor

nx-cloud bot commented Sep 11, 2025

View your CI Pipeline Execution ↗ for commit e888dba

Command Status Duration Result
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m 48s View ↗
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 1m 33s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx documentation ✅ Succeeded 55s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-11 23:18:55 UTC

Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud is proposing a fix for your failed CI:

We fixed the TypeError in the internal link checker script by updating the readSiteMapIndex function to handle both single and multiple sitemap entries, and added error handling in readSiteMapLinks to gracefully handle missing sitemap files. This resolves the build failure that was preventing the nx-dev:build task from completing successfully.

We verified this fix by re-running nx-dev:build.

Suggested Fix changes
diff --git a/scripts/documentation/internal-link-checker.ts b/scripts/documentation/internal-link-checker.ts
index eff6c05..66c3eb5 100644
--- a/scripts/documentation/internal-link-checker.ts
+++ b/scripts/documentation/internal-link-checker.ts
@@ -82,20 +82,31 @@ function readSiteMapIndex(directoryPath: string, filename: string): string[] {
   const parser = new XMLParser();
   const sitemapIndex: {
     sitemapindex: {
-      sitemap: {
-        loc: string;
-      };
+      sitemap:
+        | {
+            loc: string;
+          }
+        | {
+            loc: string;
+          }[];
     };
   } = parser.parse(readFileContents(join(directoryPath, filename)));
-  return [
-    join(
-      directoryPath,
-      sitemapIndex.sitemapindex.sitemap.loc.replace('https://nx.dev', '')
-    ),
-  ];
+
+  const sitemaps = Array.isArray(sitemapIndex.sitemapindex.sitemap)
+    ? sitemapIndex.sitemapindex.sitemap
+    : [sitemapIndex.sitemapindex.sitemap];
+
+  return sitemaps.map((sitemap) =>
+    join(directoryPath, sitemap.loc.replace('https://nx.dev', ''))
+  );
 }
 
 function readSiteMapLinks(filePath: string): string[] {
+  if (!existsSync(filePath)) {
+    console.warn(`Warning: Sitemap file does not exist: ${filePath}`);
+    return [];
+  }
+
   const parser = new XMLParser();
   const sitemap: {
     urlset: {

Apply fix via Nx Cloud  Reject fix via Nx Cloud  Nx CloudView interactive diff and more actions ↗


⚙️ An Nx Cloud workspace admin can disable these reviews in workspace settings.

@barbados-clemens barbados-clemens merged commit 12b4725 into master Sep 12, 2025
16 checks passed
@barbados-clemens barbados-clemens deleted the cu/DOC-155-sitemaps branch September 12, 2025 12:47
jaysoo pushed a commit that referenced this pull request Sep 17, 2025
Copy link
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants